<!doctype html>
<html lang="en" xmlns:v-bind="http://www.w3.org/1999/xhtml" xmlns:v-on="http://www.w3.org/1999/xhtml" xmlns:v-model="http://www.w3.org/1999/xhtml" xmlns:v-demo="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        .router-link-active {
            color:#f00;
        }
        pre {
            font-family: sans-serif;
            font-size: 1em;
            line-height:1.5em;
        }

    </style>
</head>
<body>
    <div id="app">
        <router-view class="header" name="header"></router-view>
        <router-view class="main" name="main"></router-view>
        <router-view class="footer"></router-view>
    </div>
</body>

<script src="../../../vender/vue@2.4.2.js"></script>
<script src="../../../vender/vue-router@2.7.0.js"></script>

<script>
    const Header={template:`<h1>Header</h1>`};
    const Main={template:`<div>Main</div>`};

    const router=new VueRouter({
        routes:[
            {
                path:'/',
                components:{
                    header:Header,
                    main:Main,
                    default:{
                        template:`<div>Footer</div>`
                    }
                }
            }
        ]
    });

    const app=new Vue({
        router
    }).$mount('#app');

</script>
</html>